home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4431 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.3 KB  |  33 lines

  1. Path: due.unit.no!usenet
  2. From: Per Ivar Helgesen <ph@iok.unit.no>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: DLL Trouble
  5. Date: Tue, 30 Jan 1996 11:25:28 +0000
  6. Organization: SINTEF Applied Economics
  7. Message-ID: <310E0028.568C@iok.unit.no>
  8. References: <4ehig2$7d3@newsbf02.news.aol.com>
  9. NNTP-Posting-Host: markus.iok.unit.no
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b5 (Win95; I)
  14.  
  15. Jason Cone wrote:
  16. > I am trying to use Turbo C++ Visual Edition for Windows to write a DLL
  17. > which contains a single exportable function called rolldice....
  18. > Following is the C/C++ code for the DLL:... 
  19. > int far pascal _export rolldice(int, int);
  20.  
  21. I guess that your procedure-name is getting mangled by C++.
  22. I assume that you haven't made a def-file with the procedure-name listed,
  23. since you have declared the function as _export.
  24.  
  25. You have to declare your "rolldice"-procedure as extern "C":
  26. extern "C" int far pascal _export rolldice(int sides, int qty)
  27. This will prevent name-mangling, hope that helps.
  28.  
  29. ___  ////  __________________________________________________   
  30.     |--00    Per Ivar Helgesen, SINTEF Applied Economics
  31.     C   ^    ph@iok.unit.no   , tel +47 7359 0806
  32. ___  \ ~/  __________________________________________________
  33.